﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace NGUYENTHANHDONG.OOP.Inhertance___Polimophism.EXCERCISES.EXCERCISE_05
{
    public partial class DangKyBanQuyen : Form
    {
        public DangKyBanQuyen()
        {
            InitializeComponent();
        }

        private void DangKyBanQuyen_Load(object sender, EventArgs e)
        {
            cmbBangTan.Items.Add("CDMA");
            cmbBangTan.Items.Add("WCDMA");
            cmbBangTan.Items.Add("GSM");
            cmbBangTan.SelectedIndex = 0;

            cmbTanSo.Items.Add("900 Mhz - 902 Mhz");
            cmbTanSo.Items.Add("903 Mhz - 905 Mhz");
            cmbTanSo.Items.Add("906 Mhz - 908 Mhz");
            cmbTanSo.SelectedIndex = 0;
        }

        int Maso = 0;
        private void btnDangKi_Click(object sender, EventArgs e)
        {
            errorProvider1.Clear();

            if(string.IsNullOrEmpty(txtNhaCCDV.Text))
            {
                errorProvider1.SetError(txtNhaCCDV, "Khong dc de trong !!");
                txtNhaCCDV.Focus();
            }
            else

            {
                Maso++;
                ISO9001 iso = new ISO9001();
                iso.BangTan(cmbBangTan.Text);
                iso.TanSo(cmbTanSo.Text);

                lsbKetQua.Items.Add("Mã Số: " + Maso + ":" + txtNhaCCDV.Text);
                lsbKetQua.Items.Add("+ đăng kí băng tần: " + iso.BANGTAN);
                lsbKetQua.Items.Add("+ đăng kí tần số: " + iso.TANSO);
            }
        }
    }
}
